package only.my.railgunys.shooting;

import only.my.railgunys.artifact.ArtifactSuitEffect;
import only.my.railgunys.artifact.imp.BlizzardStrayer;
import only.my.railgunys.bean.Character;
import only.my.railgunys.bean.Enemy;
import only.my.railgunys.utils.ArtifactSetUtils;
import only.my.railgunys.utils.FightUtils;
import only.my.railgunys.weapon.AmosBow;
import only.my.railgunys.weapon.ThunderingPulse;

import java.util.Comparator;
import java.util.List;

import static only.my.railgunys.utils.Crutch.doubleIceTeam;
import static only.my.railgunys.utils.FightUtils.initNormal90;

public class Ganyu {
    public static void main(String[] args) {
        Ganyu ganyu1 = new Ganyu();
        Character characterTp = ganyu1.init90GanyuThundering();
        Character characterAmos = ganyu1.init90GanyuAmos();
        List<Character> amosWith25wordsBlizzard4 = with25wordsBlizzard4(characterAmos);
        List<Character> tpWith25wordsBlizzard4 = with25wordsBlizzard4(characterTp);
        System.out.println(tpWith25wordsBlizzard4.get(tpWith25wordsBlizzard4.size() -1));
        System.out.println(amosWith25wordsBlizzard4.get(amosWith25wordsBlizzard4.size() -1));
    }

    private static List<Character> with25wordsBlizzard4(Character characterAmos) {
        List<Character> temp = ArtifactSetUtils.mainStatRollEnhance(characterAmos);
        List<Character> characters = ArtifactSetUtils.possibleStatRollEnhance(temp,25);

        ArtifactSuitEffect blizzardStrayer4 = new BlizzardStrayer();
        characters.stream()
                .map(blizzardStrayer4::setEffect2Piece)
                .map(blizzardStrayer4::setEffect4Piece)
                .forEach(FightUtils::calcTotalDmg);
        characters.sort(Comparator.comparingInt(Character::getTotalDmg));
        return characters;
    }

    public  static Character initGanyu90Shooting(){
        Character ayaka = new Character();
        ayaka.setHp(9797D);
        ayaka.setAtk(335D);
        ayaka.setCritDmg(88.4);
        ayaka.setCritRate(25D);
        ayaka.setDescription("90级甘雨");
        ayaka.setIncrease(20D);
        return ayaka;
    }

    Character init90GanyuThundering(){
        Character ganyu90Shooting = initGanyu90Shooting();
        Enemy enemy = initNormal90(1);
        ganyu90Shooting.setEnemy(enemy);
        ganyu90Shooting.setSkillDmg(6.22);
        doubleIceTeam(ganyu90Shooting);

        ThunderingPulse thunderingPulse = new ThunderingPulse(1);
        thunderingPulse.mainStatEnhance(ganyu90Shooting);
        thunderingPulse.subStatEnhance(ganyu90Shooting);

        return ganyu90Shooting;
    }

    Character init90GanyuAmos(){
        Character ganyu90Shooting = initGanyu90Shooting();
        Enemy enemy = initNormal90(1);
        ganyu90Shooting.setEnemy(enemy);
        ganyu90Shooting.setSkillDmg(6.22);
        doubleIceTeam(ganyu90Shooting);

        AmosBow amosBow = new AmosBow(1);
        amosBow.mainStatEnhance(ganyu90Shooting);
        amosBow.subStatEnhance(ganyu90Shooting);
        amosBow.specialAbility(ganyu90Shooting);

        return ganyu90Shooting;
    }
}
